import 'package:backend.core/core/domain/entities/web/web_money_amount.dart';
import 'package:backend.purchases/domain/entities/yookassa_api/yookassa_api_money_amount.dart';

abstract class CreateYookassaApiMoneyAmountFromInternalOne {
  YookassaApiMoneyAmount call({
    required WebMoneyAmount moneyAmount,
  });
}

class CreateYookassaApiMoneyAmountFromInternalOneImpl
    implements CreateYookassaApiMoneyAmountFromInternalOne {
  const CreateYookassaApiMoneyAmountFromInternalOneImpl();

  @override
  YookassaApiMoneyAmount call({
    required WebMoneyAmount moneyAmount,
  }) {
    return YookassaApiMoneyAmount(
      value: moneyAmount.value,
      currency: moneyAmount.currency,
    );
  }
}
